home *** CD-ROM | disk | FTP | other *** search
- Path: surfnet.nl!sun4nl!xs4all!falstaff
- From: falstaff@xs4all.nl (Falstaff)
- Newsgroups: comp.lang.c
- Subject: Re: Standard question - pointer initialization
- Date: 6 Mar 1996 23:24:43 GMT
- Organization: XS4ALL, networking for the masses
- Message-ID: <4hl6rr$nde@news.xs4all.nl>
- References: <4hk9un$906@hammer.msfc.nasa.gov>
- NNTP-Posting-Host: xs1.xs4all.nl
- X-Newsreader: NN version 6.5.0 #666 (NOV)
-
- Brian.Day@msfc.nasa.gov (Brian Day) writes:
-
- >Hi all,
-
- >I don't have a copy of the ANSI standard handy, and was wondering
- >if y'all could answer a question for me.
-
- >We were recently handed a coding standard which said:
-
- > "Always initialize pointers when they are declared"
-
- >Doesn't the standard say something about some pointers
- >being automatically initialized to NULL, or something like that?
-
- No. Pointers like any other variables are not automagically initialized.
-
- >Is this coding standard wise?
-
- Even though using uninitialized pointers may lead to crashing your
- system (especially non-memory-managed systems) faster than other
- uninitialized variables, both omissions will lead to errors in the
- program.
- Compilers may help in detecting uninitialized variables, but otherwise
- good programming practises should be followed to try to eliminate
- these errors before they are programmed in.
-
- Frank
- --
- The famous GIICM now on line: http://www.xs4all.nl/~falstaff/GIICM.html
- ------------------------------------------------------------------------
- Frank A. Vorstenbosch +31-(70)-355 5241 falstaff@xs4all.nl
-